Timer is a class that allows you to receive triggers at regular intervals. More...
#include <timer.h>
Public Member Functions | |
virtual void | stop ()=0 |
Stop the timer. | |
Static Public Member Functions | |
static Timer * | create (ITimerCallback *callback, uint32 intervalMilliseconds) |
Create a timer with a given interval. |
Timer is a class that allows you to receive triggers at regular intervals.
Note: The timer class is an abstract base class with (hidden) platform specific subclasses.
Usage:
class TimerReceiver : public FObject, public ITimerCallback { ... virtual void onTimer (Timer* timer) { // do stuff } ... }; TimerReceiver* receiver = new TimerReceiver (); Timer* myTimer = Timer::create (receiver, 100); // interval: every 100ms ... ... if (myTimer) myTimer->release (); if (receiver) receiver->release ();
static Timer* create | ( | ITimerCallback * | callback, | |
uint32 | intervalMilliseconds | |||
) | [static] |
Create a timer with a given interval.
callback | The receiver of the timer calls. | |
intervalMilliseconds | The timer interval in milliseconds. |
virtual void stop | ( | ) | [pure virtual] |
Stop the timer.